﻿// Copyright (c) egmkang wang. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

namespace Gateway
{
    using System;
    using System.Configuration;

    public static class GatewaySettings
    {
        public static int Port => int.Parse(ConfigurationManager.AppSettings["port"]);
        public static string LogPrefix
        {
            get
            {
                var str = ConfigurationManager.AppSettings["log_prefix"];
                return String.IsNullOrWhiteSpace(str) ? "gateway" : str;
            }
        }

        public static NLog.LogLevel LogLevel
        {
            get
            {
                var str = ConfigurationManager.AppSettings["log_level"];
                return String.IsNullOrWhiteSpace(str) ? NLog.LogLevel.Debug : NLog.LogLevel.FromString(str);
            }
        }
    }
}
